Extending forms and tables

When you create new variform definitions, using the extends attribute to inherit the implementation of an existing form or table is an easy way of reusing and building on what is already there. The advantage of using extends versus copying the code that implements an existing form or table is that the extending variform changes whenever the extended variform changes.

When you extend an existing variform, everything defined in that variform gets included in the new variform. Unless you add new items or edit inherited items, the two variforms will look alike; only the variform ID will be different. If you add items to the new variform, they will appear at the end.

Extends works on various levels, meaning that you can extend a variform that extends another variform, and so on. For example, Table C can extend Table B, which extends Table A.

The following limitations exist:

In the following example, the second table extends the first table; it adds a new title and adds some additional attributes for a child table.

<table id="TABLE_SANDBOX_GOOS">

unit

<name>Goo</name>

</entity>

<crudCommand variformId="FORM_SANDBOX_GOO"/>

 

<attributes>

<attribute key="aVariformAttribute" value="aVariformAttributeValueFromTable"/>

</attributes>

 

<menu category="context">

<menuItem userActionId="EDIT_GOOS_SDC_FIELDS" label="Edit statically defined dynamic component"

      variformId="SANDBOX_FORM_GOO_SDC_COMPONENTS" enable="oneSource"/>

</menu>

<column fieldId="gooName"/>

<column fieldId="gooActive"/>

<column fieldId="gooBoolean"/>

<column fieldId="gooBooleanNullable"/>

 

<column fieldId="gooStaticallyDefinedDynamicComponent.gooSDCUser"/>

<column fieldId="gooStaticallyDefinedDynamicComponent.gooSDCUser.buserUid"/>

<column fieldId="gooStaticallyDefinedDynamicComponent.gooSDCFoo.fooName"/>

<column fieldId="gooSynthetic" display="viewable" simpleQuery="always"/>

<column fieldId="gooOmitted" display="viewable" simpleQuery="omit"/>

<column fieldId="gooSyntheticDefault" display="viewable"/>

</table>

 

<!--For launching goos table from foo table's action menu-->

<table id="TABLE_SANDBOX_GOOS_FOR_FOO" extends="TABLE_SANDBOX_GOOS">

<title>Goos for Foo</title>

<attributes>

<attribute key="masterRefFieldId" value="gooFoo"/>

</attributes>

</table>